package com.ums.scumspay.exception;

/**
 * @author sunLin
 * @description
 * @time 2023/3/1 22:49
 **/
public enum BizCode {
    /**
     * 统一错误
     */
    SUCCESS(200, "成功"),
    ERROR(-500, "服务异常!"),
    PARAMS_ERROR(-501, "请求参数异常!"),
    ILLEGAL_ERROR(-401, "非法请求", false),
    SERVER_ERROR(-502, "业务处理异常!", false),
    LOGIN_ERROR(-401, "登录失败!"),
    ACCESS_ERROR(-403, "暂未登录或权限不足!"),
    LOGIN_OUT_ERROR(-401, "未登录或登录已过期"),

    ;
    /**
     * 错误编码
     */
    private final Integer code;
    /**
     * 错误描述
     */
    private String des;
    /**
     * 错误详情
     */
    private String msg;

    /**
     * 是否需要打印日志默认true
     */
    private Boolean isLog;

    BizCode(Integer code, String des) {
        this.code = code;
        this.des = des;
        this.isLog = true;
    }

    BizCode(Integer code, String des, Boolean isLog) {
        this.code = code;
        this.des = des;
        this.isLog = isLog;
    }
    public Integer getCode() {
        return this.code;
    }

    public String getDes() {
        return this.des;
    }

    public String getMsg() {
        return this.msg;
    }

    public Boolean getIsLog() {
        return this.isLog;
    }

    public void setDes(String des) {
        this.des = des;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public void setIsLog(Boolean isLog) {
        this.isLog = isLog;
    }
}
